#ifndef SHORTCUTUI_H
#define SHORTCUTUI_H

#include "settinggroup.h"
#include "addbutton.h"
#include "fixlabel.h"
#include "titlelabel.h"
#include "doubleclicklineedit.h"
#include "clickfixlabel.h"
#include "addshortcutdialog.h"
#include <QHBoxLayout>
#include <QWidget>
#include <QMenu>

class ShortcutUi : public QWidget
{
    Q_OBJECT
public:
    ShortcutUi();
    ~ShortcutUi();
    void addSystemShortcut(const QString &name, const QString &shortcut);
    void addCustomShortcut(KeyEntry keyEntry, KeyEntryList *systemEntryList, KeyEntryList *customEntryList);
    void clearCustomShorcutFrame();

private:
    void initUi();
    void initSystem();
    void initCustom();
    QString getShowShortcutString(QString src);

private:
    QVBoxLayout *uiLayout     = nullptr;
    QVBoxLayout *systemLayout = nullptr;
    QVBoxLayout *customLayout = nullptr;

private:
    TitleLabel   *systemTitle         = nullptr;
    SettingGroup *systemShortcutGroup = nullptr;

private:
    TitleLabel   *customTitle         = nullptr;
    SettingGroup *customShortcutGroup = nullptr;
    AddButton    *addButton           = nullptr;

Q_SIGNALS:
    void deleteShortcut(const QString &path);
    void toCreateShortcut(QString path, QString name, QString exec, QString key, bool buildFlag = true, bool convertFlag = true);
    void addButtonClicked();
};

#endif // SHORTCUTUI_H
